﻿<UserControl x:Class="LaunchPad.Core.Controls.EffectControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:LaunchPad.Core.Controls"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:lp="clr-namespace:LaunchPad.Core"
             mc:Ignorable="d" 
             d:DesignHeight="318" d:DesignWidth="589" xmlns:my="clr-namespace:LaunchPad.Core" >
    <UserControl.Resources>
        <Style TargetType="{x:Type local:EffectControl}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsHovered}" Value="True">
                    <Setter Property="Foreground" Value="LightSteelBlue" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=IsHot}" Value="True">
                    <Setter Property="Background" Value="Red" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <ObjectDataProvider MethodName="GetValues"
                        ObjectType="{x:Type sys:Enum}"
                        x:Key="EffectPortValues">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="lp:EffectPort" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>
    <Grid>
        <CheckBox Content="Hot" Height="16" HorizontalAlignment="Right" Margin="0,20,12,0" VerticalAlignment="Top" IsChecked="{Binding Path=IsHot, UpdateSourceTrigger=PropertyChanged}" />
   
        <local:EffectTimelineControl Margin="0,118,0,0" VerticalAlignment="Stretch" x:Name="effectTimelineControl" />
           
        <CheckBox Content="Enabled" Height="16" HorizontalAlignment="Right" IsChecked="{Binding Path=Enabled, UpdateSourceTrigger=PropertyChanged}" Margin="0,20,55,0" VerticalAlignment="Top" />
        <ComboBox Height="32" HorizontalAlignment="Stretch" Name="comboBox1" VerticalAlignment="Top" Margin="12,12,120,0" 
                  ItemsSource="{Binding Source={x:Static lp:ProductFactory.Instance}, Path=Products}" SelectedValue="{Binding Product}"
                  DisplayMemberPath="Name" FontSize="16" />
        <Label Content="Group" Height="28" HorizontalAlignment="Left" Margin="12,50,0,0" VerticalAlignment="Top" />
        <TextBox Name="groupTextBox" Height="28" HorizontalAlignment="Stretch" Text="{Binding Group, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Margin="61,50,120,0" TabIndex="1" />
        <Label Content="Node" Height="28" HorizontalAlignment="Left" Margin="16,84,0,0" VerticalAlignment="Top" />
        <ComboBox DisplayMemberPath="Name" FontSize="16" Height="28" HorizontalAlignment="Stretch" Margin="60,84,257,0" Name="nodeComboBox" SelectedValue="{Binding Node}" VerticalAlignment="Top" />
        <ComboBox ItemsSource="{Binding Source={StaticResource EffectPortValues}}" 
                                              Text="{Binding Path=Port, Mode=TwoWay, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}" 
                                              FontWeight="Bold"
                                              VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,84,120,0" Height="28" Width="93" />
        <Label Content="Port" Height="28" HorizontalAlignment="Right" Margin="0,84,219,0" VerticalAlignment="Top" />
    </Grid>
</UserControl>
